	<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>拉拉货物流有限公司</title>
		<meta name="keywords" content="拉拉货物流有限公司,汕头物流配送,汕头物流,汕头物流货运,汕头货运,全国货运,厦门物流配送,深圳物流配送,广州物流配送,物流配送,物流货运,货运配送" />
	    <meta name="description" content="拉拉货物流有限公司是一家承接全国各地门到门配送业务的专业第三方物流，为企业量身定做仓储、配送物流方案，针对大小客户配备专业项目小组进行专人专车对接。" />
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	    <link rel="stylesheet" href="css/amazeui.min.css" type="text/css" />
	    <link rel="stylesheet" href="css/style.css" type="text/css" />
		<link rel="stylesheet" href="layui/css/layui.css">

	</head>
	<body class="bgcolor">
		<header data-am-widget="header" class="am-header am-header-default header-white">
	      <div class="am-header-left am-header-nav">
		     <a href="javascript:history.back()" class=""><i class="am-icon-chevron-left"></i></a>
	      </div>
	      <h1 class="am-header-title">用户注册</h1>
	      <div class="am-header-right am-header-nav">
	      	<a href="tel:10086">帮助</a>
	      </div>
        </header>
        <div class="jl"></div>
		<form action="" method="post">
        <input type="text" name="userName" id="confirmname" placeholder="请输入用户名" class="login-name mt20" >
        <input type="password" name="passWord" id="pps" placeholder="请输入密码" class="login-name mt20">
		<input type="password" name="Confirmpassword" id="confirm" placeholder="确认密码" class="login-name mt20" >
        <input type="text" id="mobile1" name="tel" placeholder="请输入手机号" class="login-name mt20">
        <input type="text" name="mail" placeholder="请输入邮箱（找回密码）" class="login-name mt20">
        <div class="yzm mt20">
	    	<input type="text" name="code" class="reg-yzm" placeholder="输入验证码">
	    	<input type="button" class="yzm-hq" value="获取验证码" id="yzm">
	    </div>
	    <div class="agree">
	    	<input type="checkbox" name="checkbox" value="同意" checked="">&nbsp;同意
		    <a href="" class="reg1">《拉拉货物流用户协议》</a>
	    </div>
	    <input type="button" id="reg" class="login-btn" value="注册">
		</form>
	</body>
	<script type="text/javascript" src="js/jquery.min.js" ></script>
	<script type="text/javascript" src="js/amazeui.min.js" ></script>
	<script src="layui/layui.js"></script>
	<script >
		layui.use(['layer', 'form','jquery'], function(){
			var layer = layui.layer;
			var  $ =layui.jquery;
			var url= JSON.parse(sessionStorage.getItem("url"))
			//注册事件
			$("#reg").click(function () {
				if($("#pps").val()!=$("#confirm").val()){
					layer.msg("确认密码不一致",{icon:5});
					return false;
				}
				if ($(":checked").length==0){
					layer.msg("请阅读并勾选确认《拉拉货物流用户协议》",{icon:5});
					return false;
				}
				$.ajax({
					url:url+'/user/register',
					type:'post',
					dataType:'json',
					data:$("form").serialize(),
					success:function (r) {
						if(r.code!=200){
							layer.msg(r.message,{icon:5});
						}else{
							location.href="login.html"
						}
					}

				})


			})
		 	//手机验证码的发送和倒计时
               $(".yzm-hq").click(function () {
                  var  number=$("#mobile1").val();
				   var code = $("#yzm");
				   code.attr("disabled","disabled");
				   setTimeout(function(){
					   code.css("opacity","0.8");
				   },1000)
				   var time = 60;
				   var set=setInterval(function(){
					   code.val("("+--time+")秒后重新获取");
				   }, 1000);
				   setTimeout(function(){
					   code.attr("disabled",false).val("重新获取验证码");
					   clearInterval(set);
				   }, 60000);
                 $.ajax({
                     url:url+"/Verification/code?number="+number,
                     type:"get",
                     dataType:"json",
                     success:function (r) {
                         if (r=="success"){
                             alert("发送成功")
                         }else {
                             alert("发送失败")
                         }
                     }
                     
                     
                 })

               })


         /* //确认密码输入后事件
			 function onblur() {
                    if($("input[name='password']")!=$("input[name='password']")){
                        alert("密码不一致")
                    }
			}*/



		});
	</script>
</html>
